{% load bootstrap3 %}
{% load staticfiles %}
<!DOCTYPE html>
<html>
<head lang="zh-cn">
    <meta charset="UTF-8">
    <meta content="csrfmiddlewaretoken" name="csrf-param" />
    <meta content="{{ csrf_token|safe }}" name="csrf-token" />
    <title>{% block title %}{{ title }}{% endblock %}</title>
    {% bootstrap_css %}
    <link href="{% static 'css/style.css' %}" rel="stylesheet">
    {% block css %}{% endblock %}
    <script src="{% static 'js/jquery-1.11.1.js' %}"></script>
    <script src="{% static 'js/underscore.js' %}"></script>
    <script src="{% static 'js/backbone.js' %}"></script>
    <script src="{% static 'js/common.js' %}"></script>
    {% block script %}{% endblock %}
    {% bootstrap_javascript %}
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-default" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Design</a>
        </div>
        <div class="navbar-collapse collapse">
            {% block nav %}
            <ul class="nav navbar-nav">
                <li><a href="#">首页</a></li>
                <li><a href="#about">关于我们</a></li>
                <li><a href="#contact">联系我们</a></li>
            </ul>
            {% endblock %}
            <div class="navbar-right">
                {% if user.is_authenticated %}
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">欢迎！{{ user.nickname }}<span class="caret"></span></a>
                               <ul class="dropdown-menu" role="menu">
                                <li><a href="{% url 'profile' %}">个人资料</a></li>
                                <li><a href="{% url 'logout' %}">退出</a></li>
                              </ul>
                        </li>
                    </ul>
                {% else %}
                    <ul class="nav navbar-nav">
                        <li><a href="{% url 'login' %}">登录</a></li>
                        <li><a href="{% url 'register' %}">注册</a></li>
                    </ul>
                {% endif %}
            </div>
        </div>
        <!--/.nav-collapse -->
    </div>
</div>
<div class="container">
    {% block content %}
    {% endblock %}
</div>
{% block footer %}
{% endblock %}
</body>
</html>
